
<%@ page import="java.util.List" %>
<%@ page import="domain.model.group.Group" %>
<%@ page import="domain.model.user.User" %>

<h2> ${title} </h2>
<p>View Groups Information below: </p>

<div id="queryContents">

		
		<table border="1" style="border-collapse: collapse;">
			<tr>
				<th>Group Name</th>
				<th>Description</th>
			</tr>
			<%
			
				List<Group> groups = (List<Group>)request.getAttribute("groups");
				List<User> users = (List<User>)request.getAttribute("users");
				for(Group group: groups)
				{
			%>
				<tr>
					<td>
						<a href="" onclick="showTeam(<%=group.getId()%>); return false;" ><%=group.getName()%></a>
						<div id="group_box_<%=group.getId()%>" style="display: none; text-align:left;">
							<br />
							<% for(User u: users)
							   {
								if(u.getGroup().getId() == group.getId())
								{
							%>
								- <%=u.getFirstName()%> <%=u.getLastName()%><br />
							<% 	} 
							   }
							%>
						</div>
					</td>
					<td><%=group.getDescription()%></td>
				</tr>
			<%
				}
			%>
		</table>
</div> <!--closing queryContents -->